<template>
  <div class="top">
      <img src="../images/top-logo.png" alt="">
      <div class="fr">
          <div class="input-search fl" style="display:none;">
            <el-input v-model="search"    prefix-icon="el-icon-search"></el-input>
          </div>
          <div class="fl top-state">
              <div class="fl top-states">
                <img src="../images/top-peop.png" title="我要推荐">
              </div>
              <div class="fl top-states">
                <img src="../images/top-ring.png" alt="" title="消息通知">
              </div>
              <div class="fl top-states">
                <img src="../images/top-phone.png"  alt="" title="下载APP">
              </div> 
          </div>
          <div class="fl top-role">
              <div class="role-img fl">
                  <img src="../images/top-img.png" alt="">
              </div>
              <div class="role-role fl">
                  <el-dropdown trigger="click"  @command="handleCommand">
                    <span class="el-dropdown-link">
                      管理员<i class="el-icon-caret-bottom el-icon--right"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item class="clearfix">
                        帮助中心
                      </el-dropdown-item>
                      <el-dropdown-item class="clearfix">
                        个人资料
                      </el-dropdown-item>
                      <el-dropdown-item class="clearfix">
                        切换账号
                      </el-dropdown-item>
                      <el-dropdown-item class="clearfix" command>
                        退出登录
                      </el-dropdown-item>
                    </el-dropdown-menu>
                  </el-dropdown>
              </div>
          </div>
      </div>
      
  </div>
</template>

<script>
export default {
  data() {
    return {
      search: ""
    };
  },
  methods: {
    handleCommand() {
      localStorage.setItem("uid", "");
      localStorage.setItem("token", "");
      localStorage.setItem("reToken", "");
      localStorage.setItem("time", "");
      this.$router.push("/");
      setTimeout(function() {
        document.getElementById("logins").style.display = "block";
        document.getElementById("txt").style.display = "none";
        document.getElementById("china").style.display = "block";
      }, 10);
    }
  }
};
</script>

<style lang="less" >
@import "../css/var.less";
.top {
  height: 60px;
  width: 100%;
  background: linear-gradient(to right, #009ea3, #11bcc2);
  line-height: 60px;
  padding-left: 16px;
  padding-right: 22px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  .el-input__inner {
    height: 36px;
    width: 130px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    &:focus {
      border: none;
    }
  }
  .input-search {
    padding-right: 20px;
    height: 60px;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    input:focus {
      width: 200px;
    }
  }
  .top-state {
    padding-right: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    .top-states {
      position: relative;
      width: 70px;
      text-align: center;
      cursor: pointer;
      &::before,
      &::after {
        position: absolute;
        top: 50%;
        left: 50%;
        margin: -20px 0 0 -20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        content: "";
        opacity: 0;
        pointer-events: none;
      }
    }
  }
  .top-role {
    .role-img {
      width: 44px;
      height: 44px;
      border-radius: 100%;
      background: #fff;
      margin: 8px 24px 0;
      overflow: hidden;
      line-height: 44px;
      text-align: center;
    }
    .role-role {
      color: #ffffff;
      font-size: 14px;
      cursor: pointer;
    }
  }
}
.top-states::before,
.top-states::after {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.top-states:hover::before,
.top-states:hover::after {
  -webkit-animation-name: anim-effect-jagoda-2, anim-effect-jagoda-1;
  animation-name: anim-effect-jagoda-2, anim-effect-jagoda-1;
  -webkit-animation-duration: 1.2s;
  animation-duration: 1.2s;
  -webkit-animation-iteration-count: 5;
  animation-iteration-count: 5;
  -webkit-animation-timing-function: ease-out;
  animation-timing-function: ease-out;
  -webkit-animation-fill-mode: forwards;
  animation-fill-mode: forwards;
}
.top-states:hover::after {
  -webkit-animation-delay: 0.6s;
  animation-delay: 0.6s;
}
@-webkit-keyframes anim-effect-jagoda-1 {
  0%,
  100% {
    opacity: 0;
  }
  40%,
  60% {
    opacity: 1;
  }
}
@keyframes anim-effect-jagoda-1 {
  0%,
  100% {
    opacity: 0;
  }
  40%,
  60% {
    opacity: 1;
  }
}
@-webkit-keyframes anim-effect-jagoda-2 {
  0% {
    -webkit-transform: scale3d(0.5, 0.5, 1);
    transform: scale3d(0.5, 0.5, 1);
  }
  100% {
    -webkit-transform: scale3d(1.4, 1.4, 1);
    transform: scale3d(1.4, 1.4, 1);
  }
}
@keyframes anim-effect-jagoda-2 {
  0% {
    -webkit-transform: scale3d(0.5, 0.5, 1);
    transform: scale3d(0.5, 0.5, 1);
  }
  100% {
    -webkit-transform: scale3d(1.4, 1.4, 1);
    transform: scale3d(1.4, 1.4, 1);
  }
}
</style>

